Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial code for a mobile friendly scoreboard. #2447

Open
wants to merge 212 commits into
base: wfluxor
Choose a base branch
from

Conversation

nickygerritsen
Copy link
Member

Missing:

  • ❤️.
  • Probably some logic based on whether things are enabled (like problems). Affiliation display logic should be mostly there.
  • Extensive testing for non-finals settings.
  • Maybe some cleanup of the code/logic.
  • Maybe not do this on non public scoreboards?

But we want to use this for the public scoreboard in Luxor, so hence this initial PR.

vmcj and others added 6 commits April 7, 2024 09:17
When checking the masking of the ICPC WF online mirror we encountered a
404 for /public/scoreboard, this route is now added to make sure we can
get a scoreboard user /jury, /team & /public (where the last is the same
as what we do get for /public).

This does lead to an ugly situation in case there is no public contest
and there is self-registration but as that is also the special case we
want to protect against actually targeting the /scoreboard route (if we
would need it in the future) there would make sure we directly read that
code and consider that special case.
Previously, we didn't handle the case correctly where the uploaded team
output was truncated but the display limit was set to `-1`/untruncated -
which obviously can only show what we have in the DB.
While we plan to merge runguard and runpipe (see
https://docs.google.com/document/d/1WZRwdvJUamsczYC7CpP3ZIBU8xG6wNqYqrNJf7osxYs/edit#heading=h.i7kgdnmw8qd7),
this is a "minimal" change to signal (in the literal meaning of the
word) to runpipe that runguard killed the program because of a
timelimit.
@meisterT
Copy link
Member

meisterT commented Apr 8, 2024

Maybe not do this on non public scoreboards?

Agreed.

What is strange: I looked now on my phone (and not with chrome devtools) and it is way too wide... but only until the first refresh, then it's fine. Do we fix the width too late?

@nickygerritsen
Copy link
Member Author

Might be that I broke something when moving this to the js file. Will check

@meisterT
Copy link
Member

meisterT commented Apr 8, 2024

I quickly looked into the hearts. It is non-trivial to re-use the same code, so we might have to duplicate it.

@nickygerritsen
Copy link
Member Author

Might be that I broke something when moving this to the js file. Will check

Should be fixed now, it indeed executed the javascript before the page was loaded, which broke when I moved the code to the .js file.

It now also only shows the mobile scoreboard on the public page.

meisterT and others added 19 commits April 8, 2024 20:24
There is no need to refresh when viewing an individual internal error as
no new relevant new information is being added and refreshing /
scrolling around makes it hard to copy/paste things.
It is easy to mistake the `=` in an if condition as `==`, so split it
into two statements for better readability.
Otherwise, if you edit and resubmit or replay submissions (even when
submitting as other teams) it would show up in the judging verifier.
At the first level a mismatch in keys should be reported separately,
but at deeper compare levels, they should be reported in the diff.
Do with with the extra parameter `key_mismatch_in_diff=True`.

Also replace unused dummy variables `m,n` by `_`.
They are using a font that is approximately the same as in the
original PDF logo, but the 'j' was overlapping with the 'M', so
move 'judge' up a little bit.

Also have a separate black & white only logo versus a logo with
grey shadows, but on a white background.
This fixes an error where Symfony internal code would send a
URL in the message that contains a `%` and context as an
associative array. Note that `array_is_list` is available since
PHP >= 8.1, which is our minimum supported version.

Closes #2395
On the public scoreboard page, all team pictures are loaded on page
load. Similar to the affiliation logos, these should be lazy-loaded
on-demand. Also change from `id` to `class`, as there should not be
multiple elements with the same `id` on a page.
Previously, the freeze and end times of contests would be set as
timestamps. However, the `updateTimes` method overwrites the values from
their string representation on update. Therefore, the requested update
was not persisted in the database.
nickygerritsen and others added 17 commits August 16, 2024 09:10
Fixes #2646.

We used to persist the entity both before and after calling the lifecycle callbacks ourselves, which would introduce weird behavior where Doctrine wanted to insert some rows twice.
By not persisting before calling the callbacks ourselves, this issue goes away.
Also point to the legacy ICPC version for now. A new version is
planned to be released in September around the ICPC World Finals
in Astana, but until that's finalized, point to what we're actually
(roughly) implementing currently.
In other places, the logs are nicely base64 encoded and the twig
template applies a base64 decoding
(`webapp/templates/jury/internal_error.html.twig`) to render the
judgehost logs. This seems to be missed on this place.

Fixes issue #2456.
The wrong state was picked in the past, PHPStan found this in an unrelated other issue.
Debian testing started using different quotes in the generated configure
scripts.

Co-authored-by: Tobias Werth <[email protected]>
I find it easier to follow when all the composer commands are in the
same Makefile.

Also move `composer auto-scripts` back into inplace-install-l, out of
concern for ordering issues. It was moved into a prereq of
inplace-install in commit ab267ec (Put lib/vendor close to the
webapp, 2024-06-23).
Just moving around the lines, no functional changes.
Checked all remaining foreign keys using:
```
SELECT
    rc.DELETE_RULE, rc.UPDATE_RULE,
    kcu.TABLE_NAME, kcu.COLUMN_NAME, kcu.CONSTRAINT_NAME, kcu.REFERENCED_TABLE_NAME, kcu.REFERENCED_COLUMN_NAME
FROM
  INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu
INNER JOIN information_schema.REFERENTIAL_CONSTRAINTS AS rc ON kcu.CONSTRAINT_NAME = rc.CONSTRAINT_NAME
WHERE
  kcu.REFERENCED_TABLE_SCHEMA = 'domjudge'
  AND DELETE_RULE = 'RESTRICT';
```

After some discussion with Jaap it was decided to set columns referring
to judgedaemons to null instead of cascading the delete. A single
foreign key's delete rule is kept as 'restrict' since that case looks to
be sensible.

Fixes #2464, #2465.
The old foreign key was set to cascade, deleting the entire submission
when a user got deleted. This feels conceptually wrong since a
submission is connected to a team and not to a user. The user of the
team of the submission is more 'metadata' than anything else.
Extract the OS/release information

This is not 100% doable with /etc/os-release only. The Debian difference
between Release & Codename is not shown in the official containers for
example. See: https://hub.docker.com/_/debian
Previously, there were two scenarios that are problematic:
- while handling an error, we start writing the meta file, and if that
  also fails, we treat this as handling a new error and never stop;
- while writing the meta file, we encounter an error which in turn tries
  writing to the meta file causing another error and we never stop.
Even if we cannot match anything we would have had an array containing an empty array. That array indicates that nothing was matched.

We should now fail when:
- preg_match_all fails
- preg_match_all returns it found 0 matches
- the redundant case (as safeguard) when the array has 0 matches
nickygerritsen and others added 8 commits September 6, 2024 11:46
On my laptop creating a rejudging for the whole of WF46 went from 807 seconds to 16 seconds, a 50x improvement.

(cherry picked from commit e6406f8)
- Make team names not fall of the screen by calculating their max width.
- Make non mobile scoreboard not left-aligned.
- Add a bit of margin to the header.
- Make the problem boxes right aligned.
- Change the card at the top to show 2 lines (name + contestt time) on mobile.
@vmcj
Copy link
Member

vmcj commented Sep 6, 2024

@nickygerritsen you want to retarget this to wfastana?

@nickygerritsen
Copy link
Member Author

I rebased it on Astana then rebased Astana on this so it's already there. Changing the target will tell you hopefully there are no changes

@meisterT
Copy link
Member

For the record: Pending submissions didn't work in the end, but we may have broken them by the triangle thingy in the jury interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.